<!doctype html>
<!--
Tests that screen taps aren't registered while in an immersive WebXR session.
-->
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css">
  </head>
  <body>
    <canvas id="webgl-canvas"></canvas>
    <script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script>
    <script src="../resources/webxr_e2e.js"></script>
    <script src="../resources/webxr_boilerplate.js"></script>
    <script>
      setup({single_test: true});

      var numTaps = 0;
      webglCanvas.addEventListener("click", () => {numTaps++;}, false);

      function stepVerifyNoInitialTaps() {
        assert_equals(numTaps, 0, "No initial taps");
        finishJavaScriptStep();
      }

      function stepVerifyNoAdditionalTaps() {
        // We expect 1 tap from entering VR
        assert_equals(numTaps, 1,
            "Only one tap registered after two taps given");
        done();
      }

    </script>
  </body>
</html>
